{include file="Include/H_ui_head" /}
<article class="page-container">
		<form action="javascript:;" method="post" class="form form-horizontal" id="form-admin-add" enctype="multipart/form-data">
			<!-- <input type="hidden" name="id" value="" /> -->
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text j-ipt" value="" placeholder="" id="username" name="username">
					<input type="hidden" value="" name="user_id" id="user_id" class="j-ipt">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" value="" class="input-text j-ipt" placeholder="手机号" name="mobile" id="mobile">
				</div>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">推荐人账号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text j-ipt" value="" placeholder="推荐人账号" name="p_phone" id="p_phone">
				</div>
			</div>

			<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>代理商等级：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<!-- <input type="text" class="input-text j-ipt" value="" placeholder="推荐人" name="pid" id="pid"> -->
						<select name="agent" id="agent" class="input-text j-ipt">
							<option value="1">一级代理商</option>
							<option value="2">二级代理商</option>
							<option value="3">三级代理商</option>
							<option value="4">分公司</option>
						</select>
					</div>
			</div>
			
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>开户名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text j-ipt" value="" placeholder="开户名" name="realname" id="realname">
				</div>
			</div>
			<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>开户行：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<select name="bankName" id="bankName" class="input-text j-ipt">
							{foreach $result as $res}
							<option value="{$res.bankId}">{$res['bankName']}</option>
							{/foreach}
						</select>
					</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>银行卡号：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text j-ipt" value="" placeholder="银行卡号" name="bankId" id="bankId">
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" id="search">
				</div>
			</div>
			</form>
</article>


<script type="text/javascript" src="__LIB__/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__LIB__/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__STATIC__/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/h-ui.admin/js/H-ui.admin.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__LIB__/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="__STATIC__/common.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});

	$("#search").click(function(){
		//手机号正则
		var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
		//电话
		var phone = $.trim($('#mobile').val());
		if (!phoneReg.test(phone)) {
			layer.msg('请输入有效的手机号码！',{time:2000});
			return false;
		}
		var username = $("#username").val();
		if(username == '')
		{
			layer.msg('用户名不能为空',{time:2000});
			return false;
		}
		var params = getParams('.j-ipt');
		var loading =layer.msg('正在提交数据，请稍后...',{time:5000});
		$.post('{:url("Member/add")}',params,function(data){
			layer.close(loading);
			if(data.code=='1'){
				layer.msg(data.msg,{time:2000});
				setTimeout(function(){
					layer_close(this.index);
				},1000);
			}else{
				layer.msg(data.msg,{time:2000});
			}
		});
	})
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
